package com.wk.slaveNodes;

import java.util.concurrent.SynchronousQueue;

import com.wk.job.Job;

public class GetToCalculate implements Runnable{
	SynchronousQueue<Job> calculatingAJob= null;
	Job job = null;
	boolean isWorking = true;
	public GetToCalculate(SynchronousQueue<Job> calculatingAJob) {
		this.calculatingAJob = calculatingAJob;
	
	}
	
	@Override
	public void run() {
		while(isWorking){
			try {
				job = calculatingAJob.take();
				CalculateAJob.Calculate.calculate(job);
				
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}

}
